<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="125px">
      <el-form-item label="学员名称" prop="stuName">
        <el-input
          v-model="queryParams.stuName"
          placeholder="请输入学员名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item><el-form-item label="学员编号" prop="stuCode">
        <el-input
          v-model="queryParams.stuCode"
          placeholder="请输入学员编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="教练名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入教练名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="phone">
        <el-input
          v-model="queryParams.phone"
          placeholder="请输入联系方式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['course:AmountInfo:add']"
        >新增</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row> -->

    <el-table v-loading="loading" :data="AmountInfoList" @selection-change="handleSelectionChange">
      <el-table-column label="教练名称" align="center" prop="name" />
      <el-table-column label="联系方式" align="center" prop="phone" />
      <el-table-column label="学员名称" align="center" prop="stuName" />
      <el-table-column label="学员编号" align="center" prop="stuCode" />
      <el-table-column label="上课时间" align="center" prop="upClassTime" />
      <el-table-column label="课程类型" align="center" prop="classTypeName" />
      <el-table-column label="金额" align="center" prop="amount" />
      <el-table-column label="交付中心名称" align="center" prop="paCenterName" />
      <el-table-column label="交付中心编号" align="center" prop="paCenterCode" />
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

  </div>
</template>

<script>
import { coachAmount} from "@/api/course/Coach";

export default {
  name: "AmountInfo",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 金额明细表格数据
      AmountInfoList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        stuCode: null,
        stuName: null,
        name: null,
        phone: null,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询金额明细列表 */
    getList() {
      this.loading = true;
      coachAmount(this.queryParams).then(response => {
        this.AmountInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  }
};
</script>
